<!DOCTYPE html>
<html>

<head>
    <title>我的收藏</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap-4.1.1-dist/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/message.css"/>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <script src="/js/checkLogin.js"></script>
    <script src="/js/common.js"></script>
</head>

<script>
    $(function(){
        if (user.id) {
            //根据用户id获取对应的收藏
            $.get(baseUrl+"/likesAndCollects/myCollects/"+user.id,function(data){
//                console.log({list:data});
                $("#myCollects").renderValues({list:data},{
                    getHref:getHref
                });
            });
            //给收藏的游记绑定点击事件
           /* $(".nav-item-1").click(function(){
            });*/
            /**
             * 获取指定地区的攻略数据
             * 资源:/likesAndCollects/myTravelCollects/{userId}
             * 请求方式:get
             * 请求参数:userId
             * 返回值:PageIfo
             */
            $.get(baseUrl+"/likesAndCollects/myTravelCollects/"+user.id,function(data){
//                console.log({list:data});
                $("#travelCollects").renderValues({list:data},{
                    getHref:getHref
                });
            });
        }
    })
</script>

<body style="background: url('/upload/2.bmp')">
<!--4D4C4B-->
<div class="search-head" style="background: url('/upload/2.bmp')">
    <div class="row nav-search">
        <div class="col-2">
            <a href="javascript:history.go(-1);">
                <span><i class="fa fa-chevron-left" style="color: #007bff"></i></span>
            </a>
        </div>
        <div class="col-8">
            <span style="color: #007bff;font-weight: bold">我的收藏</span>
        </div>
        <div class="col-2"></div>
    </div>
</div>
<hr>
<ul class="nav nav-pills nav-justified border border-left-0 border-top-0 border-right-0" id="pills-tab" role="tablist">
    <li class="nav-item">
        <a class="nav-link active show" data-toggle="pill" href="#myCollects">
            <span>收藏的攻略</span>
            <!--style="font-weight: bold;-->
        </a>
    </li>
    <li class="nav-item">
        <a class="nav-link show" data-toggle="pill" href="#travelCollects">
            <span>收藏的游记</span>
            <!-- style="font-weight: bold;"-->
        </a>
    </li>
</ul>

<div class="tab-content" id="pills-tabContent">
    <div id="myCollects" class="tab-pane fade active show">
        <div render-loop="list">
            <ul class="list-group">
                <a data-url="/strategyCatalogs.html?id=" render-fun="getHref" render-key="list.id">
                    <li class="list-group-item d-flex justify-content-between align-items-center">
                        <div class="item">
                            <img width="30px" render-src="list.coverUrl">
                            <span render-html="list.title">成都攻略</span>
                        </div>
                    </li>
                </a>
            </ul>
        </div>
    </div>

    <div id="travelCollects" class="tab-pane fade">
        <div render-loop="list">
            <ul class="list-group">
                <a data-url="/travelContent.html?id=" render-fun="getHref" render-key="list.id">
                    <li class="list-group-item d-flex justify-content-between align-items-center">
                        <div class="item">
                            <img width="30px" render-src="list.coverUrl">
                            <span render-html="list.title">成都攻略</span>
                        </div>
                    </li>
                </a>
            </ul>
        </div>
    </div>
</div>

</body>

</html>